package charstream;

import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

public class Demo4 {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入用户名");
        String userName = sc.next();
        System.out.println("请输入密码");
        String userPass = sc.next();

        FileWriter fr = new FileWriter("Day13\\a.txt");
        fr.write(userName);
        fr.write("\r\n");
        fr.write(userPass);
        fr.flush();
        fr.close();
    }
}
